package com.baizhi.utils;

import java.util.Random;

/**
 * @author benben278
 * @create 2022-04-15 16:08
 */
public class SaltUtils {
    //生成随机salt的静态方法
    public static String getSalt(int n){
        char[] chars = "ABCDEFGHIJKLMNOPQ".toCharArray();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            char aChar = chars[new Random().nextInt(chars.length)];
            sb.append(aChar);
        }
        return sb.toString();
    }
}
